This invention relates to computers and a registry stored on a computer. More particularly, this invention relates to a method for automatically updating the data stored in a registry when an application program module is booted.
A registry is oftentimes used in a computer to store information about files. The registry is a database repository for information about a computer""s configuration. It is organized in a hierarchical structure, and is comprised of subtrees and their keys, hives, and value entries. The registry keys, or keys, contain information that may be required for an application to run. Registry Keys are often paths to specific files.
Maintaining information in a registry is problematic due to a user""s tendency to move folders and resources. For example, in the Macintosh version of the MICROSOFT OFFICE program module, or xe2x80x9cMACOFFICE 4.2xe2x80x9d program module, manufactured by Microsoft Corporation of Redmond, Wash., an installer program module was required to set the appropriate information in the registry. Several common user actions could render the xe2x80x9cMACOFFICE 4.2xe2x80x9d program module inoperative. For example, if a user changed something as minor as the hard drive name of their computer, the paths in the registry would be broken and the xe2x80x9cMACOFFICE 4.2xe2x80x9d program module would not work properly.
There were several other common actions that caused malfunctions in the registry in association with the xe2x80x9cMACOFFICE 4.2xe2x80x9d program module. Some of these actions that caused malfunctions were:
a user moving components from one location to another on the hard drive;
a user renaming their hard drive;
a user renaming several of the folders on their hard drive;
a system administrator xe2x80x9cpushingxe2x80x9d an application program module to clients, such as by using the xe2x80x9cNORTON ADMINISTRATORxe2x80x9d program module or the xe2x80x9cAPPLE NETWORK ADMINISTRATOR TOOLKITxe2x80x9d, or xe2x80x9cANATxe2x80x9d, program module;
a user reinstalling the operating system;
a user installing an operating system upgrade;
a user dragging the appropriate components to the hard drive of the computer and placing them in the appropriate location;
a user renaming a file; and
a user moving the installer program module to another hard drive on the same computer.
All of these malfunctions originated from the registry, which is used by all Object Linking and Embedding (OLE) aware applications. Products such as the xe2x80x9cADOBE PAGEMAKERxe2x80x9d program module, MACINTOSH version, also exhibit some of these malfunctions.
The xe2x80x9cWINDOWSxe2x80x9d version of the xe2x80x9cOFFICExe2x80x9d program module, manufactured by Microsoft Corporation of Redmond, Wash., has solved some of the above-described problems using a self-registration application program module, known as the selfreg dynamic link library or selfreg.dll, installed on the computer. When the selfreg.dll is called, it stores registry keys in the registry. Thus, an installer program module is not needed to set the registry keys. The registry keys to be registered are stored in a .srg file, which is a pre-authored text file. When the selfreg.dll is called, the location of the .srg file is passed to the selfreg.dll. The selfreg.dll will then register all registry keys contained in the .srg file. Self-registration using the selfreg.dll is comparable to an installer program module registering the registry keys for an application program module.
However, there are several drawbacks to the selfreg.dll. For example, there is a need for someone to install the selfreg.dll before it will function. Another problem is that the selfreg.dll may get moved or deleted so that it will not function. Another drawback of the selfreg.dll is that there is the need for someone to install the .srg file. Another drawback of the selfreg.dll is that the .srg file may become out of sync with the selfreg.dll, causing the selfreg.dll to register an incorrect version of a registry key. Still another drawback is that the .srg file could be deleted or moved, causing the selfreg.dll to malfunction. Still another drawback is that someone needs to explicitly call the selfreg.dll, because it does not happen automatically.
Thus, there is a need for a method for automatically updating a computer registry. There is also a need for a method for automatically updating a computer registry after a user renames their hard drive, renames several of the folders on their hard drive, installs or reinstalls the operating system, renames a file, or moves the installer program module to another hard drive on the same computer. There is also a need for a method for automatically updating a computer registry when a system administrator xe2x80x9cpushesxe2x80x9d an application program module to clients.
There is also a need for a method for automatically updating a computer registry without the user having to install the selfreg.dll or the .srg file. There is also a need for a method for automatically updating a computer registry without the user having to explicitly call the selfreg.dll.
The present invention satisfies the above described needs by providing a method for automatically updating a registry stored on a computer when an application program module is booted.
In one aspect, the invention is incorporated into a computer system and is a method for automatically registering resources required for an application program module to execute. The method begins when the application program module is booted. The status of a registration cache stored in association with the application program module is examined to determine whether a registry on the computer system needs to be updated. The registration cache is stored in association with the application program module and indicates whether a registry on the computer system needs to be updated, such as after the user has moved files or renamed files such that registry keys in the registry may no longer be valid.
If the registration cache indicates that the registry needs to be updated, then a search is made through a predetermined directory, such as the application program module folder. The search is looking for an application file or a dynamic link library file. Upon detecting an application file or a dynamic link library file, then a resource fork in association with the file is opened.
After opening the resource fork, it is determined whether there is a self-registration resource in the resource fork. If so, then the self-registration resource is registered by initiating a call to a dynamic link library, selfreg.dll. A determination is made whether there is an OTLB an Object Linking and Embedding (OLE) Type Library (OTLB) resource in the resource fork. An OTLB resource is a resource containing binary data that describes how to register an OLE type library. If so, then the OTLB resource is registered by initiating an OLE call RegisterTypeLib.
These and other features, advantages, and aspects of the present invention may be more clearly understood and appreciated from a review of the following detailed description of the disclosed embodiments and by reference to the appended drawings and claims.